SaGet Functions
.#include "SaPopCalls.h" char *SaCopyLocalBuffer(char *str);
str
argument. The returned value should not be free'd.SaCopyLocalBuffer
returns a duplicate of the string passed to it in the str
argument.
SaCopyLocalBuffer
adds a copy of the str
buffer to the local ring buffer that is managed in SaPopCalls.c and returns a pointer to the copy in the ring buffer.
The ring buffer is a list of up to 10 strings. When an eleventh item is added to it, the first item is removed and free'd and the eleventh item is appended to the end of the ring buffer. This assures that functions using the ring buffer can be called nine times before buffers are free'd and therefore become invalid.
This is used primarily with Widget HTML Form Element Extraction functions that are embedded in other functions which require character pointers. This eliminates the need to free a returned string since it will be free'd automatically once the 11th string is added.